Win32: move CoInitialize to dnd init
authorPaolo Borelli <pborelli@gnome.org>
Mon, 14 Dec 2015 18:40:25 +0000 (19:40 +0100)
committerPaolo Borelli <pborelli@gnome.org>
Thu, 17 Dec 2015 16:18:01 +0000 (17:18 +0100)
commit2e5616b27ea72947d9b61cf2be6d61d65a2d1df7
tree3f1e1bbd9097196648fccb09fd5ff7ad366aefd0
parentf6b0067718471bebaa3beeafc9d0260a53dd7e26
Win32: move CoInitialize to dnd init

Functions requiring CoInitialize are called just in two places:
 - the filechooser thread which calls its own CoInitializeEx
 - the dnd code

Moving CoInitialize in the dnd specific init is cleaner and
we can pair it with the corresponding CoUninitialize since
CoUninitialize should be called as many times as CoInitialize.
Note that it is ok to call this function multiple times, so it
will not break if another codepath will need it in the future.

The patch also replaces the deprecated CoInitialize with the
equivalent call to CoInitializeEx (already used in the filechooser).
gdk/win32/gdkdnd-win32.c
gdk/win32/gdkmain-win32.c